package com.example.jasonrpc.server.simple;

import com.example.jasonrpc.common.ReflectionUtils;
import com.example.jasonrpc.proto.Request;

/**
 * 调用具体的服务
 */
public class ServiceInvoker {
    public Object invoke(ServiceInstance instance, Request request) {
        return ReflectionUtils.invoke(instance.getTarget(),
                                      instance.getMethod(),
                                      request.getParameters());
    }
}
